package com.niiwoo.civet.trade.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.Getter;

/**
 * 投资订单关闭原因
 * Created by zhangwanli on 2018/5/14.
 */
@Getter
public enum InvestOrderCloseReasonEnum {
    PAY_CANCELED((byte) 1, "取消付款关闭"),
    PAY_TIMEOUT((byte) 2, "超时未付款关闭"),
    INVEST_OVERTIME((byte) 3, "标的募集超时关闭"),
    MANAGER_CANCEL((byte) 4, "管理员人工关闭"),;

    private Byte value;
    private String desc;

    InvestOrderCloseReasonEnum(Byte value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static InvestOrderCloseReasonEnum enumOf(Byte value) {
        for (InvestOrderCloseReasonEnum reasonEnum : values()) {
            if (reasonEnum.value.equals(value)) {
                return reasonEnum;
            }
        }
        throw new NoSuchEnumValueException("InvestOrderCloseReasonEnum:" + value);
    }

}
